<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>

<HEAD>
<META HTTP-EQUIV="Content-Type" Content="Windows-1252">
<title>background Attribute</title>
<style>@import url(coUA.css);</style>
</HEAD>

<BODY>
<h3><a name="cssattr_0001000301000100"></a>background Attribute </h3>
<p>
{ <b>background:</b> <b>transparent</b>| &lt;<b>color&gt;</b> || &lt;<b>url&gt;</b> || &lt;<b>repeat&gt;</b> || &lt;<b>scroll&gt;</b> || &lt;<b>position&gt;</b>}<BR></p>
<p>
'background' describes the background of an element. </p>
<p>
This attribute is not inherited. </p>
<p>
<b>Settings</b></p>
<p>
Background can be any one of the below
<ul>
<li>
one color <br><br></li>
<li>
two colors which will be blended according to the 'bg-blend-direction' property an image pointed to by a URI, possibly combined with one color or two blended colors <br><br></li>
<li>
transparent </li>
</ul>
<p>
Corresponding examples: </p>
<p>
BODY { background: red }                       /* one color */</p>
<p>
  h3 { background: blue / red }                  /* blend two colors */</p>
<p>
  BODY { background: &quot;chess.png&quot; black / white } /* img + color combo */</p>
<p>
  P { background: transparent }</p>
<p>
This property does not inherit, but the parent element's background will shine through by default due to the initial transparent value. </p>
<p>
If an image is found through the URI, it will be overlaid on top of any color specified. The color (or color combination) is used: 
<ul>
<li>
to fill transparent regions of an image <br><br></li>
<li>
while loading the image from the URI <br><br></li>
<li>
if no URI is specified </li>
</ul>
<p>
&lt;repeat&gt; </p>
<p>
Value: repeat | repeat-x | repeat-y | no-repeat Initial: repeat scroll </p>
<p>
By default, the background image is repeated both in the x and y direction. </p>
<p>
BODY { background: http://style.com/marble.png repeat-x }</p>
<p>
  BODY { bg-style: repeat-y }</p>
<p>
&lt;scroll&gt; </p>
<p>
Value: scroll | fixed Initial: scroll </p>
<p>
This property describes how the background image should be laid out. By default, the image is scrolled along with the other content. A 'fixed' background is fixed with regard to the canvas. </p>
<p>
BODY { bg-style: repeat-x }</p>
<p>
  BODY { bg-style: repeat-x scroll }</p>
<p>
&lt;position&gt; </p>
<p>
Value: &lt;percentage&gt; | &lt;length&gt; | left | center | right [ &lt;percentage&gt; | &lt;length&gt; | top | middle | bottom]? Initial: 0% 0% </p>
<p>
The property describes the initial position of a background image specified with the 'background' property. If only one value is given, it sets both the horizontal and vertical offset of the background image. If two values are given, the horizontal position comes first. </p>
<p>
With a value pair of '0% 0%', the upper left corner of the image is placed in the upper left corner of the element. A value pair of '100% 100%' places the lower right corner of the image in the lower right corner of the element. With a value pair of '14% 84%', the point 14% across and 84% down the image is to be placed at the point 14% across and 84% down the element. </p>
<p>
If the background image is fixed with regard to the canvas (a possible value of 'bg-style'), the images are placed relative to the canvas instead of the element. E.g.: </p>
<p>
BODY { </p>
<p>
    background: url(logo.png) fixed 100% 100%;</p>
<p>
  } </p>
<p>
In the example above, the image is placed in the lower right corner of the canvas. </p>
<p>
The keyword values are defined as follows: </p>
<p>
left   = 0%</p>
<p>
  center = 50%</p>
<p>
  right  = 100%</p>
<p>
  top    = 0%</p>
<p>
  middle = 50%</p>
<p>
  bottom = 100%</p>
</BODY>
</HTML>
